<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>thymeleaf模板</title>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="webjars/jquery/3.6.0/jquery.min.js"></script>
    <script src="webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        .container{
            margin-top: 20px;
        }
        .table{
            text-align: center;
        }
    </style>
    </head>
<body>
<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title" style="text-align: center">hero list</h3>
        </div>
        <table class="table">
            <tr>
                <td>英雄名称</td>
                <td>操作</td>
            </tr>
            <tr th:each="hero : ${heros}">
                <td th:text="${hero}"></td>
                <td>
                    <a href="#" class="btn btn-success btn-sm">修改</a>
                    <a href="#" class="btn btn-danger btn-sm">删除</a>
                </td>
            </tr>
        </table>
        <div class="panel-footer text-right">
         【ld2022】
        </div>
    </div>
</div>

</body>
<!--1. 可以在js中取出thymeleaf的值-->
<script th:inline="javascript">
    let heros = [[${heros}]];
    console.log("heros:",heros);
</script>
</html>

